<?php
/**
 * Amazon报告
 * (amazon-model)
 */
namespace App\Models\Amazon;

use Illuminate\Database\Eloquent\Model;
class CreateAndGetReport extends Model
{
    protected $connection = 'mysql_amazon';

    protected $table = 'create_and_get_report';

    protected $guarded  = [];

    //报告状态
    public static $_processingStatus = ['CANCELLED', 'DONE', 'FATAL'];

    public static function getParseClass($reportType){
        $arr = explode('_',$reportType);
        $parseClass = '';
        foreach($arr as $item){
            $parseClass .= ucfirst(strtolower($item));
        }
        return $parseClass;
    }

    //是否计划报告
    const IS_SCHEDULE_NO = 0; //否
    const IS_SCHEDULE_YES = 1; //是
    public static $_isSchedule = [
        self::IS_SCHEDULE_NO => '否',
        self::IS_SCHEDULE_YES => '是',
    ];

    //是否已解析
    const IS_PARSE_NO = 0; //待解析
    const IS_PARSE_YES = 1; //已解析
    public static $_isParse = [
        self::IS_PARSE_NO => '待解析',
        self::IS_PARSE_YES => '已解析',
    ];

    //解析结果说明
    const PARSE_DESC_NO = 0; //未解析
    const PARSE_DESC_SUCCESS = 1; //解析正常
    const PARSE_DESC_ERROR = 2; //解析异常
    const PARSE_DESC_NULL = 3; //无需解析
    public static $_parseDesc = [
        self::PARSE_DESC_NO => '未解析',
        self::PARSE_DESC_SUCCESS => '解析正常',
        self::PARSE_DESC_ERROR => '解析异常',
        self::PARSE_DESC_NULL => '无需解析'
    ];
}
